package xyz.heyaoshare.common.entity.bo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

/**
 * 分页查询基础参数
 * @author YueHe
 * @version 0.0.1
 * @since 2025/6/25 上午10:20
 */
@Data
@Schema(description = "分页查询基础参数")
public class PageParam {

    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小为{value}")
    @Schema(description = "页码", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer page;

    @NotNull(message = "每页条数不能为空")
    @Range(min = 1, max = 10000, message = "每页条数取范围在{min}-{max}之间")
    @Schema(description = "每页条数", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer size;

}